From 0e4670150aa4519d40e341b67d9c1377f9712749 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Wed, 18 Apr 2012 22:15:32 +0200 Subject: [PATCH] csssection: Remove file argument from constructor The parser has the file available. --- gtk/gtkcssprovider.c | 3 +-- gtk/gtkcsssection.c | 9 ++++----- gtk/gtkcsssectionprivate.h | 3 +-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c index d57ccd062b..748bff760f 100644 --- a/gtk/gtkcssprovider.c +++ b/gtk/gtkcssprovider.c @@ -1406,8 +1406,7 @@ gtk_css_scanner_push_section (GtkCssScanner *scanner, section = _gtk_css_section_new (scanner->section, section_type, - scanner->parser, - scanner->file); + scanner->parser); if (scanner->section) gtk_css_section_unref (scanner->section); diff --git a/gtk/gtkcsssection.c b/gtk/gtkcsssection.c index 007a308b9b..85fd0647ef 100644 --- a/gtk/gtkcsssection.c +++ b/gtk/gtkcsssection.c @@ -49,13 +49,11 @@ G_DEFINE_BOXED_TYPE (GtkCssSection, gtk_css_section, gtk_css_section_ref, gtk_cs GtkCssSection * _gtk_css_section_new (GtkCssSection *parent, GtkCssSectionType type, - GtkCssParser *parser, - GFile *file) + GtkCssParser *parser) { GtkCssSection *section; g_return_val_if_fail (parser != NULL, NULL); - g_return_val_if_fail (file == NULL || G_IS_FILE (file), NULL); section = g_slice_new0 (GtkCssSection); @@ -63,8 +61,9 @@ _gtk_css_section_new (GtkCssSection *parent, section->section_type = type; if (parent) section->parent = gtk_css_section_ref (parent); - if (file) - section->file = g_object_ref (file); + section->file = _gtk_css_parser_get_file (parser); + if (section->file) + g_object_ref (section->file); section->start_line = _gtk_css_parser_get_line (parser); section->start_position = _gtk_css_parser_get_position (parser); section->parser = parser; diff --git a/gtk/gtkcsssectionprivate.h b/gtk/gtkcsssectionprivate.h index ddf7b37ee3..12c13aaba0 100644 --- a/gtk/gtkcsssectionprivate.h +++ b/gtk/gtkcsssectionprivate.h @@ -26,8 +26,7 @@ G_BEGIN_DECLS GtkCssSection * _gtk_css_section_new (GtkCssSection *parent, GtkCssSectionType type, - GtkCssParser *parser, - GFile *file); + GtkCssParser *parser); GtkCssSection * _gtk_css_section_new_for_file (GtkCssSectionType type, GFile *file); -- 2.30.2